# https://code.google.com/archive/p/rdf3x/wikis/Usage.wiki
# Download Wikidata 
# Decompress :/
# bunzip2 ....bz2
# or
# gunzip ....gz
# assumes the input file is ./wikidata.nt
wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/rdf3x/rdf3x-0.3.8.zip
unzip rdf3x-0.3.8.zip
cd rdf3x-0.3.7

# fix casts in source code that cause errors in modern compilers
sed -i 's/return getline/return (bool) getline/g' tools/rdf3xquery/rdf3xquery.cpp
sed -i 's/return editHistory/return (bool) editHistory/g' tools/rdf3xquery/rdf3xquery.cpp

make
bin/rdf3xload wdl wikidata.nt